import { EntitySchema } from '@mikro-orm/core';

export class LeGoodsExport {
  id!: string;
  conditions!: string;
  goodsData!: unknown;
  merchantId!: string;
  createdTime!: string;
  updatedTime?: string;
  deletedTime?: string;
  isDeleted: boolean = false;
  AppID!: string;
}

export const LeGoodsExportSchema = new EntitySchema({
  class: LeGoodsExport,
  properties: {
    id: { primary: true, type: 'string', columnType: 'bigint' },
    conditions: { type: 'string', columnType: 'text' },
    goodsData: { type: 'unknown', columnType: 'longtext' },
    merchantId: { type: 'string', columnType: 'bigint' },
    createdTime: { type: 'string', columnType: 'bigint' },
    updatedTime: { type: 'string', columnType: 'bigint', nullable: true },
    deletedTime: { type: 'string', columnType: 'bigint', nullable: true },
    isDeleted: { type: 'boolean', default: false },
    AppID: { type: 'string', fieldName: 'AppID', length: 50 },
  },
});
